// 首页的样式less文件
// @import 导入的意思 可以把一个样式文件导入到另外一个样式文件里面
// link 是把一个 样式文件引入到html页面里面
@import "common";

body{
    min-width: 320px;
    width: 15rem;
    margin: 0 auto;
    line-height: 1.5;
    font-family: Arial, Helvetica;
    background: #F2F2F2;
    height: 2000px;
}

// 页面元素rem计算公式: 页面元素的px / html 字体大小 50 (在750的设计稿里字体大小为50)
// search-content
@baseFont: 50; // 字体大小
.search-content{
    display: flex;
    position:fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    // margin-left: -7.5rem;
    // 宽度写死:
    // width: 15rem;
    width: (750rem /@baseFont);
    height: (88rem / @baseFont);
    background-color: #FFC001;

    .classify{
        width: (44rem / @baseFont);
        height: (70rem / @baseFont);
        margin: (11rem / @baseFont) (25rem / @baseFont) (7rem / @baseFont) (24rem / @baseFont);
        background: url(../images/classify.png) no-repeat;
        // 背景缩放
        background-size:(44rem / @baseFont) (70rem / @baseFont);
    }

    .search{
        flex: 1;
        input{
            width: 100%;
            height: (66rem / @baseFont);
            border-radius: (33rem / @baseFont);
            outline: 0;
            border: none;
            background-color: #FFF2CC;
            margin-top: (12rem / @baseFont);
            padding-left: (55rem / @baseFont);
            font-size: (25rem / @baseFont);
            color: #757575;
        }
    }

    .login{
        width: (75rem / @baseFont);
        height: (70rem / @baseFont);
        line-height: (70rem / @baseFont);
        margin: (10rem / @baseFont);
        font-size: (25rem / @baseFont);
        text-align: center;
        color: #fff;
    }
}

//banner
.banner{
    
    width: (750rem / @baseFont);
    height: (368rem / @baseFont);

    img{
        width: 100%;
        height: 100%;
    }
}

//ad
.ad{
    display: flex;
    // 让.ad里的链接各自占一份
    a{
        flex: 1;
        img {
            width: 100%;
        }
    }
}

//nav
.nav{
    width: (750rem / @baseFont);
    a{
        float: left;
        // 750 (设计稿宽度) / 5 (一行放5个) = 150
        width: (150rem / @baseFont);
        height: (140rem / @baseFont);
        text-align: center;

        img{
            display: block;
            // 行内元素margin无效,所以转为块级
            margin:(10rem / @baseFont) auto 0;
            width: (82rem / @baseFont);  
            height:(82rem / @baseFont);
            
        }
        
        span {
            display: block;
            font-size: (25rem / @baseFont);
            color: #333;
            margin-top: (10rem / @baseFont);
        }
    }
}

  /* 清除浮动 */
  .clearfix:after {
    content: "";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
  }

  /* 清除浮动,IE6、IE7专有 */
  .clearfix {
    *zoom: 1;
  }